#ifndef CS488_A4_HPP
#define CS488_A4_HPP

#include <string>
#include "algebra.hpp"
#include "scene.hpp"
#include "light.hpp"
#include "ray.hpp"

Colour do_phong_reflection(const Intersection& intersection, Ray ray);

Colour raytrace(Ray ray, int depth);

void find_space(const Point3D& eye);

void build_space();

bool cast_ray_to_primitives(Ray ray, Intersection *intersection);

void a4_render(// What to render
               SceneNode* root,
               // Where to output the image
               const std::string& filename,
               // Image size
               int width, int height,
               // Viewing parameters
               const Point3D& eye, const Vector3D& view,
               const Vector3D& up, double fov,
               // Lighting parameters
               const Colour& ambient,
               const std::list<Light*>& lights,
				int anti_aliasing,
				int bad_pixel,
				int depthoffield,
				double sharp_depth,
				int subdivision,
				int gridnum
               );

struct GRID{
	GRID(){}
	GRID(Point3D p1, Point3D p2):min_point(p1),max_point(p2){}
	Point3D min_point;
	Point3D max_point;
	std::list<GeometryNode*> geolist;
};

#endif
